﻿@model Qu.ComputingContest.Model.Student

<fieldset>
    <legend>Student @TempData["StudentCount"] Details</legend>
    @{TempData["StudentCount"] = ((int)@TempData["StudentCount"]) + 1;}
    @Html.HiddenFor(model => model.RegistrationID)
<table >
<tr>
    <td>
        <span class="editor-label">
            @Html.LabelFor(model => model.FirstName)<em>*</em>
        </span>
    </td>

    <td>
        <span class="editor-field">
            @Html.EditorFor(model => model.FirstName)
            @Html.ValidationMessageFor(model => model.FirstName, "*")
        </span>
    </td>

    <td>
        <span class="editor-label">
            @Html.LabelFor(model => model.MiddleName)<em>*</em>
        </span>
    </td>

    <td>
        <span class="editor-field">
            @Html.EditorFor(model => model.MiddleName)
            @Html.ValidationMessageFor(model => model.MiddleName, "*")
        </span>
    </td>

    <td>
        <span class="editor-label">
            @Html.LabelFor(model => model.LastName)<em>*</em>
        </span>
    </td>

    <td>
        <span class="editor-field">
            @Html.EditorFor(model => model.LastName)
            @Html.ValidationMessageFor(model => model.LastName, "*")
        </span>
    </td>
    </tr>

    <tr>
        <td>
            <span class="editor-label">
                @Html.LabelFor(model => model.Gender)<em>*</em>
            </span>
        </td>
        <td>
            <span class="editor-field">
                @Html.DropDownListFor(model => model.Gender, ((SelectList)ViewBag.Genders).Select(option => new SelectListItem
              {
                  Text = (option == null ? "None" : option.Text),
                  Value = option.Value.ToString(),
                  Selected = (Model != null) && (option.Value == Model.Gender)
              }), "Choose...")
                @Html.ValidationMessageFor(model => model.Gender, "*")

                @*            @Html.EditorFor(model => model.Gender)
                @Html.ValidationMessageFor(model => model.Gender, "*")*@
            </span>
        </td>
        <td>
            <span class="editor-label">
                @Html.LabelFor(model => model.SchoolYear)<em>*</em>
            </span>
        </td>
        <td>
            <span class="editor-field">
              @Html.DropDownListFor(model => model.SchoolYear, ((SelectList)ViewBag.SchoolYears).Select(option => new SelectListItem
              {
                    Text = (option == null ? "None" : option.Text),
                    Value = option.Value.ToString(),
                    Selected = (Model != null) && (option.Value == Model.SchoolYear.ToString())
              }), "Choose...")
              @Html.ValidationMessageFor(model => model.SchoolYear, "*")
@*                @Html.EditorFor(model => model.SchoolYear)
                @Html.ValidationMessageFor(model => model.SchoolYear, "*")*@
            </span>
        </td>
        <td></td><td></td>
        </tr>
        <tr>
            <td>
                <span class="editor-label">
                    @Html.LabelFor(model => model.Email)<em>*</em>
                </span>
            </td>
            <td>
                <span class="editor-field">
                    @Html.EditorFor(model => model.Email)
                    @Html.ValidationMessageFor(model => model.Email, "*")
                </span>
            </td>
            <td>
                <span class="editor-label">
                    @Html.LabelFor(model => model.Phone)
                </span>
            </td>
            <td>
                <span class="editor-field">
                    @Html.EditorFor(model => model.Phone)
                    @Html.ValidationMessageFor(model => model.Phone, "*")
                </span>
            </td>
            <td></td>
            <td></td>
    </tr>
    </table>
</fieldset>

